🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / core / service / src / jvmMain / kotlin / org / meshtastic / core / service / JvmFileService.kt
Displaying Raw • Download
core/service/src/jvmMain/kotlin/org/meshtastic/core/service/JvmFileService.kt fix/qr-error-correction (7b45f84f) Text, 2.19 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.service
Tff7b72import T7ee787co.touchlab.kermit.Logger
Tff7b72import T7ee787kotlinx.coroutines.withContext
Tff7b72import T7ee787okio.BufferedSink
Tff7b72import T7ee787okio.BufferedSource
Tff7b72import T7ee787okio.buffer
Tff7b72import T7ee787okio.sink
Tff7b72import T7ee787okio.source
Tff7b72import T7ee787org.koin.core.annotation.Single
Tff7b72import T7ee787org.meshtastic.core.common.util.CommonUri
Tff7b72import T7ee787org.meshtastic.core.di.CoroutineDispatchers
Tff7b72import T7ee787org.meshtastic.core.repository.FileService
Tff7b72import T7ee787java.io.File
Tf0883e@Single
Tff7b72class T56d364JvmFileServiceTb4b4b4(Tff7b72private Tff7b72val Te6edf3dispatchersTb4b4b4: Te6edf3CoroutineDispatchersTb4b4b4) Tb4b4b4: Te6edf3FileService Tb4b4b4{
Tff7b72override Tff7b72suspend Tff7b72fun Td2a8ffwriteTb4b4b4(Te6edf3uriTb4b4b4: Te6edf3CommonUriTb4b4b4, Te6edf3blockTb4b4b4: Te6edf3suspend Tb4b4b4(Te6edf3BufferedSinkTb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4)Tb4b4b4: Tffa657Boolean Tff7b72=
Te6edf3withContextTb4b4b4(Te6edf3dispatchersTb4b4b4.Te6edf3ioTb4b4b4) Tb4b4b4{
Tff7b72try Tb4b4b4{
T8b949e// Treat URI string as a local file path
Tff7b72val Te6edf3file Tff7b72= Te6edf3FileTb4b4b4(Te6edf3uriTb4b4b4.Te6edf3toStringTb4b4b4(Tb4b4b4)Tb4b4b4)
Te6edf3fileTb4b4b4.Te6edf3parentFileTff7b72?.Te6edf3mkdirsTb4b4b4(Tb4b4b4)
Te6edf3fileTb4b4b4.Te6edf3sinkTb4b4b4(Tb4b4b4)Tb4b4b4.Te6edf3bufferTb4b4b4(Tb4b4b4)Tb4b4b4.Te6edf3use Tb4b4b4{ Te6edf3sink Tff7b72-Tff7b72> Te6edf3blockTb4b4b4(Te6edf3sinkTb4b4b4) Tb4b4b4}
Tff7b72true
Tb4b4b4} Tff7b72catch Tb4b4b4(Te6edf3eTb4b4b4: Te6edf3ExceptionTb4b4b4) Tb4b4b4{
Te6edf3LoggerTb4b4b4.Te6edf3eTb4b4b4(Te6edf3eTb4b4b4) Tb4b4b4{ Ta5d6ff"Ta5d6ffFailed to write to URI: Tffd700$Te6edf3uriTa5d6ff" Tb4b4b4}
Tff7b72false
Tb4b4b4}
Tb4b4b4}
Tff7b72override Tff7b72suspend Tff7b72fun Td2a8ffreadTb4b4b4(Te6edf3uriTb4b4b4: Te6edf3CommonUriTb4b4b4, Te6edf3blockTb4b4b4: Te6edf3suspend Tb4b4b4(Te6edf3BufferedSourceTb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4)Tb4b4b4: Tffa657Boolean Tff7b72=
Te6edf3withContextTb4b4b4(Te6edf3dispatchersTb4b4b4.Te6edf3ioTb4b4b4) Tb4b4b4{
Tff7b72try Tb4b4b4{
Tff7b72val Te6edf3file Tff7b72= Te6edf3FileTb4b4b4(Te6edf3uriTb4b4b4.Te6edf3toStringTb4b4b4(Tb4b4b4)Tb4b4b4)
Te6edf3fileTb4b4b4.Te6edf3sourceTb4b4b4(Tb4b4b4)Tb4b4b4.Te6edf3bufferTb4b4b4(Tb4b4b4)Tb4b4b4.Te6edf3use Tb4b4b4{ Te6edf3source Tff7b72-Tff7b72> Te6edf3blockTb4b4b4(Te6edf3sourceTb4b4b4) Tb4b4b4}
Tff7b72true
Tb4b4b4} Tff7b72catch Tb4b4b4(Te6edf3eTb4b4b4: Te6edf3ExceptionTb4b4b4) Tb4b4b4{
Te6edf3LoggerTb4b4b4.Te6edf3eTb4b4b4(Te6edf3eTb4b4b4) Tb4b4b4{ Ta5d6ff"Ta5d6ffFailed to read from URI: Tffd700$Te6edf3uriTa5d6ff" Tb4b4b4}
Tff7b72false
Tb4b4b4}
Tb4b4b4}
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.04s